package top.eggcode.component.query.anno;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Title: 关联列名
 * Description: 用于描述外键的信息
 * Date: 2021/8/14 9:08
 *
 * @author JiaQi Ding
 * @version 1.0
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface JoinAttribute {


    // 映射属性，默认：字段->驼峰转下划线
    String name() default "";

    // 关联属性，默认是 ”id“
    String referenced() default "id";

    Class<?> entity();

    boolean unique() default false;

    boolean nullable() default true;
}
